﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Ranet.AgOlap.Core.MetadataDescription;

namespace Galaktika.BI.Silverlight.Controls.General.Tree
{
    public class HierarchyTreeNode : CustomTreeNode
    {
        HierarchyInfo m_Info = null;
        public HierarchyInfo Info
        {
            get {
                return m_Info;
            }
        }

        public HierarchyTreeNode(HierarchyInfo info)
        {
            if (info == null)
                throw new ArgumentNullException("info");
            
            m_Info = info;
            Text = info.Caption;

            switch (m_Info.HierarchyOrigin)
            {
                case HierarchyInfoOrigin.AttributeHierarchy:
                    Icon = UriResources.Images.AttributeHierarchy16;
                    break;
                case HierarchyInfoOrigin.ParentChildHierarchy:
                    Icon = UriResources.Images.ParentChildHierarchy16;
                    break;
                case HierarchyInfoOrigin.UserHierarchy:
                    Icon = UriResources.Images.UserHierarchy16;
                    break;
            }
        }
    }
}
